package com.starsoft.trade.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TradeSummaryId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class TradeSummaryId implements java.io.Serializable {

	// Fields

	private Integer acountId;
	private Date asofdate;

	// Constructors

	/** default constructor */
	public TradeSummaryId() {
	}

	/** full constructor */
	public TradeSummaryId(Integer acountId, Date asofdate) {
		this.acountId = acountId;
		this.asofdate = asofdate;
	}

	// Property accessors

	@Column(name = "acountId", nullable = false)
	public Integer getAcountId() {
		return this.acountId;
	}

	public void setAcountId(Integer acountId) {
		this.acountId = acountId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "asofdate", nullable = false, length = 10)
	public Date getAsofdate() {
		return this.asofdate;
	}

	public void setAsofdate(Date asofdate) {
		this.asofdate = asofdate;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TradeSummaryId))
			return false;
		TradeSummaryId castOther = (TradeSummaryId) other;

		return ((this.getAcountId() == castOther.getAcountId()) || (this.getAcountId() != null
				&& castOther.getAcountId() != null && this.getAcountId().equals(castOther.getAcountId())))
				&& ((this.getAsofdate() == castOther.getAsofdate()) || (this.getAsofdate() != null
						&& castOther.getAsofdate() != null && this.getAsofdate().equals(castOther.getAsofdate())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getAcountId() == null ? 0 : this.getAcountId().hashCode());
		result = 37 * result + (getAsofdate() == null ? 0 : this.getAsofdate().hashCode());
		return result;
	}

}